<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script>
    function f1(){
        var a = 1;
        return f2;
    }
    
    function f2(){
        return a;
    }
    
    f1()();
</script>

</head>
<body>
</body>
</html>